package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class Department {
    private Long id;
    private String name;
    private String sn;

    public String toJson() {
      /*  HashMap<Object, Object> map = new HashMap<>(); //比较安全
        map.put("id",id);
        map.put("name",name);
        map.put("sn",sn);*/
//        return JSON.toJSONString(map);
        return JSON.toJSONString(this);
    }
}